package cn.itsource.ymcc.service.impl;

import cn.itsource.ymcc.domain.CourseChapter;
import cn.itsource.ymcc.mapper.CourseChapterMapper;
import cn.itsource.ymcc.result.JsonResult;
import cn.itsource.ymcc.service.ICourseChapterService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课程章节 ， 一个课程，多个章节，一个章节，多个视频 服务实现类
 * </p>
 *
 * @author zongchangjiang
 * @since 2023-07-26
 */
@Service
public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, CourseChapter> implements ICourseChapterService {

    @Override
    public JsonResult listByCourseId(Long courseId) {
        List<CourseChapter> course_id = baseMapper.selectList(new QueryWrapper<CourseChapter>().eq("course_id", courseId));
        return JsonResult.success().setData(course_id);
    }
}
